﻿using System.Collections.Generic;

namespace Adalbertus.BudgetPlanner.Domain
{
    public class Income
    {
        public virtual int Id { get; private set; }
        public virtual string Name { get; set; }
        public IList<IncomeEntry> Entries { get; private set; }

        public Income()
        {
            Entries = new List<IncomeEntry>();
        }

        internal IncomeEntry AddIncomeEntry(decimal value, System.DateTime date)
        {
            IncomeEntry incomeEntry = new IncomeEntry
            {
                Date = date,
                Income = this,
                Value = value
            };
            Entries.Add(incomeEntry);
            return incomeEntry;
        }
    }
}
